<template>
  <div>
    <div>
  <el-table
    @cell-dblclick="Position"
    highlight-current-row
    border
    :data="this.plydata"
    style="width: 100%"
    @cell-mouse-enter="Enter"
    @cell-mouse-leave="Leave"
    :row-class-name="tableRowClassName">
    <el-table-column
      align="center"
      prop="mapCover"
      label="坐标">
    </el-table-column>
    <el-table-column
      align="center"
      prop="zindex"
      label="索引"
      width="180">
    </el-table-column>
    <el-table-column
      align="center"
      prop="name"
      label="名字"
      width="180">
    </el-table-column>
    <el-table-column
      align="center"
      prop="color"
      label="颜色"
      width="180">
    </el-table-column>
  </el-table>
    </div>

</div>
</template>

<style>

</style>

<script>
  export default {
    data() {
      return {
        title:"标题",
      }
    },
    //组件注册
    components: {
    },
    props:["plydata",],
    methods: {

      //双击单元格
      Position(row, column, cell, event){
        //row是当前行数据
        this.$router.push({name: 'editMap',params:{ cover:row}});//赋值并前往编辑页
      },

      //进入单元格
      Enter(){
        //定时加载
        var that = this
        setTimeout(function () {
          //提示
          that.$message({
            duration:1300,
            message: that.$createElement('i', { style: 'color: teal' }, '双击单元格进入编辑')
          });
        }, 800);

      },
      //离开单元格
      Leave(){
        this.$message.close()
      },

      //初始化
      tableRowClassName({row, rowIndex}) {
      },

      //弹框打开回调
      opened(){

      },
      //关闭回调
      CloseWindow(done){
        done();//关闭对话
        this.showForm = !this.showForm
      },

    },//methods

  }
</script>
